满意度.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. SET ANSI_NULLS ON
  2. GO
  3. SET QUOTED_IDENTIFIER ON
  4. GO
  5. CREATE TABLE [dbo].[tb_ErpSatisfactionRatingSet](
  6. [ID] [int] IDENTITY(1,1) NOT NULL,
  7. [Sfrs_Name] [nvarchar](50) NULL,
  8. [Sfrs_Scores] [int] NULL,
  9. [Sfrs_TotalPoints] [int] NULL,
  10. [Sfrs_CreateTime] [datetime] NULL,
  11. [Sfrs_CreateName] [nvarchar](50) NULL,
  12. [Sfrs_UpdateTime] [datetime] NULL,
  13. [Sfrs_UpdateName] [nvarchar](50) NULL,
  14. CONSTRAINT [PK_tb_ErpSatisfactionRatingSet] PRIMARY KEY CLUSTERED
  15. (
  16. [ID] ASC
  17. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  18. ) ON [PRIMARY]
  19. GO
  20. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自增长ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'ID'
  21. GO
  22. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_Name'
  23. GO
  24. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单项分值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_Scores'
  25. GO
  26. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总分值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_TotalPoints'
  27. GO
  28. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_CreateTime'
  29. GO
  30. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_CreateName'
  31. GO
  32. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_UpdateTime'
  33. GO
  34. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet', @level2type=N'COLUMN',@level2name=N'Sfrs_UpdateName'
  35. GO
  36. EXEC sys.sp_addextendedproperty @name=N'tb_ErpSatisfactionRatingSet', @value=N'满意度评分设置表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionRatingSet'
  37. INSERT [dbo].[tb_ErpSatisfactionRatingSet] ( [Sfrs_Name], [Sfrs_Scores], [Sfrs_TotalPoints], [Sfrs_CreateTime], [Sfrs_CreateName], [Sfrs_UpdateTime], [Sfrs_UpdateName]) VALUES ( N'非常满意', 5, 80, CAST(0x0000A4CF011693D9 AS DateTime), N'管理员', CAST(0x0000A4CF011753A3 AS DateTime), N'管理员')
  38. INSERT [dbo].[tb_ErpSatisfactionRatingSet] ( [Sfrs_Name], [Sfrs_Scores], [Sfrs_TotalPoints], [Sfrs_CreateTime], [Sfrs_CreateName], [Sfrs_UpdateTime], [Sfrs_UpdateName]) VALUES ( N'满意', 4, 60, CAST(0x0000A4CF0116A3D5 AS DateTime), N'管理员', CAST(0x0000A4CF01174DD6 AS DateTime), N'管理员')
  39. INSERT [dbo].[tb_ErpSatisfactionRatingSet] ( [Sfrs_Name], [Sfrs_Scores], [Sfrs_TotalPoints], [Sfrs_CreateTime], [Sfrs_CreateName], [Sfrs_UpdateTime], [Sfrs_UpdateName]) VALUES ( N'一般', 3, 40, CAST(0x0000A4CF0116D9E1 AS DateTime), N'管理员', CAST(0x0000A4CF01174953 AS DateTime), N'管理员')
  40. INSERT [dbo].[tb_ErpSatisfactionRatingSet] ( [Sfrs_Name], [Sfrs_Scores], [Sfrs_TotalPoints], [Sfrs_CreateTime], [Sfrs_CreateName], [Sfrs_UpdateTime], [Sfrs_UpdateName]) VALUES ( N'不满意', 2, 20, CAST(0x0000A4CF0116F115 AS DateTime), N'管理员', CAST(0x0000A4CF01173E3D AS DateTime), N'管理员')
  41. INSERT [dbo].[tb_ErpSatisfactionRatingSet] ( [Sfrs_Name], [Sfrs_Scores], [Sfrs_TotalPoints], [Sfrs_CreateTime], [Sfrs_CreateName], [Sfrs_UpdateTime], [Sfrs_UpdateName]) VALUES ( N'非常不满意', 1, 0, CAST(0x0000A4CF0117029D AS DateTime), N'管理员', CAST(0x0000A4CF0117595B AS DateTime), N'管理员')
  42. SET ANSI_NULLS ON
  43. GO
  44. SET QUOTED_IDENTIFIER ON
  45. GO
  46. CREATE TABLE [dbo].[tb_ErpSatisfactionReturningMattersSet](
  47. [ID] [int] IDENTITY(1,1) NOT NULL,
  48. [Sfrms_SurveySetID] [int] NULL,
  49. [Sfrms_Contents] [nvarchar](max) NULL,
  50. [Sfrms_EnableStatus] [int] NULL,
  51. [Sfrms_CreateTime] [datetime] NULL,
  52. [Sfrms_CreateName] [nvarchar](50) NULL,
  53. [Sfrms_UpdateTime] [datetime] NULL,
  54. [Sfrms_UpdateName] [nvarchar](50) NULL,
  55. CONSTRAINT [PK_tb_ErpSatisfactionReturningMattersSet] PRIMARY KEY CLUSTERED
  56. (
  57. [ID] ASC
  58. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  59. ) ON [PRIMARY]
  60. GO
  61. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动增长ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'ID'
  62. GO
  63. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对象名称ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_SurveySetID'
  64. GO
  65. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_Contents'
  66. GO
  67. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用状态(0:启用 1:不启用)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_EnableStatus'
  68. GO
  69. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_CreateTime'
  70. GO
  71. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_CreateName'
  72. GO
  73. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_UpdateTime'
  74. GO
  75. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet', @level2type=N'COLUMN',@level2name=N'Sfrms_UpdateName'
  76. GO
  77. EXEC sys.sp_addextendedproperty @name=N'tb_ErpSatisfactionReturningMattersSet', @value=N'满意度调查回访事项设置表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionReturningMattersSet'
  78. SET ANSI_NULLS ON
  79. GO
  80. SET QUOTED_IDENTIFIER ON
  81. GO
  82. CREATE TABLE [dbo].[tb_ErpSatisfactionSurveySet](
  83. [ID] [int] IDENTITY(1,1) NOT NULL,
  84. [Sfss_Name] [nvarchar](50) NULL,
  85. [Sfss_EnableStatus] [int] NULL,
  86. [Sfss_DeleteStatus] [int] NULL,
  87. [Sfss_Type] [nvarchar](1) NULL,
  88. [Sfss_CreateTime] [datetime] NULL,
  89. [Sfss_CreateName] [nvarchar](50) NULL,
  90. [Sfss_UpdateTime] [datetime] NULL,
  91. [Sfss_UpdateName] [nvarchar](50) NULL,
  92. CONSTRAINT [PK_tb_ErpSatisfactionSurveySet] PRIMARY KEY CLUSTERED
  93. (
  94. [ID] ASC
  95. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  96. ) ON [PRIMARY]
  97. GO
  98. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自增长ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'ID'
  99. GO
  100. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对象名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_Name'
  101. GO
  102. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用状态(0:启用 1:不启用)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_EnableStatus'
  103. GO
  104. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除状态(0:可删除 1:不可删除)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_DeleteStatus'
  105. GO
  106. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0:订单 1:选衣 2:拍照 3:选片 4:看样 5:取件 6:服务)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_Type'
  107. GO
  108. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_CreateTime'
  109. GO
  110. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_CreateName'
  111. GO
  112. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_UpdateTime'
  113. GO
  114. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet', @level2type=N'COLUMN',@level2name=N'Sfss_UpdateName'
  115. GO
  116. EXEC sys.sp_addextendedproperty @name=N'tb_ErpSatisfactionSurveySet', @value=N'满意度调查对象设置表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurveySet'
  117. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'接单门市', 0, 0, N'0', CAST(0x0000A4BF00E8A972 AS DateTime), N'管理员', NULL, NULL)
  118. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'礼服师', 0, 0, N'1', CAST(0x0000A4BF00E8D365 AS DateTime), N'管理员', NULL, NULL)
  119. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'摄影师', 0, 0, N'2', CAST(0x0000A4BF00E8F798 AS DateTime), N'管理员', NULL, NULL)
  120. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'摄影助理', 0, 0, N'2', CAST(0x0000A4BF00E901AA AS DateTime), N'管理员', NULL, NULL)
  121. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'化妆师', 0, 0, N'2', CAST(0x0000A4BF00E9070E AS DateTime), N'管理员', NULL, NULL)
  122. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'化妆助理', 0, 0, N'2', CAST(0x0000A4BF00E90FF4 AS DateTime), N'管理员', NULL, NULL)
  123. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'引导师', 0, 0, N'2', CAST(0x0000A4BF00E91614 AS DateTime), N'管理员', NULL, NULL)
  124. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'选片师', 0, 0, N'3', CAST(0x0000A4BF00E964F4 AS DateTime), N'管理员', NULL, NULL)
  125. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'初修师', 0, 0, N'3', CAST(0x0000A4BF00E96F79 AS DateTime), N'管理员', NULL, NULL)
  126. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'精修师', 0, 0, N'3', CAST(0x0000A4BF00E974D5 AS DateTime), N'管理员', NULL, NULL)
  127. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'看设计师', 0, 0, N'4', CAST(0x0000A4BF00E9A371 AS DateTime), N'管理员', NULL, NULL)
  128. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'设计师', 0, 0, N'4', CAST(0x0000A4BF00E9AE0A AS DateTime), N'管理员', NULL, NULL)
  129. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'产品满意度', 0, 0, N'5', CAST(0x0000A4BF00E9F1A7 AS DateTime), N'管理员', NULL, NULL)
  130. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'进度满意度', 0, 0, N'5', CAST(0x0000A4BF00E9F7B3 AS DateTime), N'管理员', NULL, NULL)
  131. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'服务人员1', 0, 0, N'6', CAST(0x0000A4BF00EA21C1 AS DateTime), N'管理员', NULL, NULL)
  132. INSERT [dbo].[tb_ErpSatisfactionSurveySet] ( [Sfss_Name], [Sfss_EnableStatus], [Sfss_DeleteStatus], [Sfss_Type], [Sfss_CreateTime], [Sfss_CreateName], [Sfss_UpdateTime], [Sfss_UpdateName]) VALUES ( N'服务人员2', 0, 0, N'6', CAST(0x0000A4BF00EA27E0 AS DateTime), N'管理员', NULL, NULL)
  133. IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = N'View_ErpSatisfactionReturningMattersSet')
  134. BEGIN
  135. DROP VIEW [dbo].View_ErpSatisfactionReturningMattersSet
  136. END
  137. GO
  138. create view View_ErpSatisfactionReturningMattersSet
  139. as
  140. SELECT tb_ErpSatisfactionReturningMattersSet.ID
  141. ,Sfrms_SurveySetID
  142. ,Sfrms_Contents
  143. ,Sfrms_EnableStatus
  144. ,Sfrms_CreateTime
  145. ,Sfrms_CreateName
  146. ,Sfrms_UpdateTime
  147. ,Sfrms_UpdateName
  148. ,Sfss_Name
  149. ,(CASE sfrms_EnableStatus WHEN '0' THEN '启用' ELSE '不启用' END ) as sfrms_EnableStatusName
  150. FROM tb_ErpSatisfactionReturningMattersSet
  151. left join tb_ErpSatisfactionSurveySet on tb_ErpSatisfactionReturningMattersSet.Sfrms_SurveySetID=tb_ErpSatisfactionSurveySet.ID
  152. go
  153. SET ANSI_NULLS ON
  154. GO
  155. SET QUOTED_IDENTIFIER ON
  156. GO
  157. CREATE TABLE [dbo].[tb_ErpSatisfactionSurvey](
  158. [ID] [int] IDENTITY(1,1) NOT NULL,
  159. [Sfs_OrderNumber] [nvarchar](50) NULL,
  160. [Sfs_OrderNumberDeputy] [nvarchar](50) NULL,
  161. [Sfs_EmployeeID] [nvarchar](50) NULL,
  162. [Sfs_Type] [int] NULL,
  163. [Sfs_SurveySetID] [int] NULL,
  164. [Sfs_ReturningMattersSetID] [int] NULL,
  165. [Sfs_RatingSetID] [int] NULL,
  166. [Sfs_Remark] [nvarchar](500) NULL,
  167. [Sfs_CreateName] [nvarchar](50) NULL,
  168. [Sfs_CreateTime] [datetime] NULL,
  169. [Sfs_UpdateTime] [datetime] NULL,
  170. [Sfs_UpdateName] [nvarchar](50) NULL,
  171. CONSTRAINT [PK_tb_ErpSatisfactionSurvey] PRIMARY KEY CLUSTERED
  172. (
  173. [ID] ASC
  174. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  175. ) ON [PRIMARY]
  176. GO
  177. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'ID'
  178. GO
  179. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'订单号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_OrderNumber'
  180. GO
  181. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'副订单号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_OrderNumberDeputy'
  182. GO
  183. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查员工ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_EmployeeID'
  184. GO
  185. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0:订单 1:选衣 2:拍照 3:选片 4:看样 5:取件 6:服务 7:其它调查' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_Type'
  186. GO
  187. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对象名称ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_SurveySetID'
  188. GO
  189. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回访事项ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_ReturningMattersSetID'
  190. GO
  191. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'满意度/评分ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_RatingSetID'
  192. GO
  193. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_Remark'
  194. GO
  195. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_CreateName'
  196. GO
  197. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_CreateTime'
  198. GO
  199. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_UpdateTime'
  200. GO
  201. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey', @level2type=N'COLUMN',@level2name=N'Sfs_UpdateName'
  202. GO
  203. EXEC sys.sp_addextendedproperty @name=N'tb_ErpSatisfactionSurvey', @value=N'满意度调查表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tb_ErpSatisfactionSurvey'
  204. GO
  205. IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = N'View_ErpSatisfactionSurvey')
  206. BEGIN
  207. DROP VIEW [dbo].View_ErpSatisfactionSurvey
  208. END
  209. GO
  210. Create view [dbo].[View_ErpSatisfactionSurvey]
  211. as
  212. SELECT tb_ErpSatisfactionSurvey.ID
  213. ,Sfs_OrderNumber
  214. ,Sfs_OrderNumberDeputy
  215. ,Sfs_EmployeeID
  216. ,(select User_Name from tb_ErpUser where Sfs_EmployeeID=User_EmployeeID) as Sfs_EmployeeName
  217. ,Sfs_Type
  218. ,Sfs_SurveySetID
  219. ,Sfss_Name as Sfs_SurveySetName
  220. ,Sfs_ReturningMattersSetID
  221. ,Sfrms_Contents
  222. ,Sfs_RatingSetID
  223. ,Sfrs_Name as Sfs_RatingSetName
  224. ,Sfs_Remark
  225. ,Sfs_CreateName as Sfs_CreateNameID
  226. ,(select User_Name from tb_ErpUser where Sfs_CreateName=User_EmployeeID) as Sfs_CreateName
  227. ,Sfs_CreateTime
  228. ,Sfs_UpdateTime
  229. ,Sfs_UpdateName as Sfs_UpdateNameID
  230. ,(select User_Name from tb_ErpUser where Sfs_UpdateName=User_EmployeeID) as Sfs_UpdateName
  231. , Ord_CustomerName1
  232. ,name1
  233. ,Ord_CustomerTelephone1
  234. ,Sfrs_Scores
  235. ,(select count(id) from tb_ErpSatisfactionReturningMattersSet where Sfrms_SurveySetID=Sfs_SurveySetID) as SatisfactionReturningMattersSetCount
  236. FROM tb_ErpSatisfactionSurvey
  237. left join tb_ErpSatisfactionSurveySet on Sfs_SurveySetID=tb_ErpSatisfactionSurveySet.ID
  238. left join tb_ErpSatisfactionReturningMattersSet on Sfs_ReturningMattersSetID=tb_ErpSatisfactionReturningMattersSet.ID
  239. left join tb_ErpSatisfactionRatingSet on Sfs_RatingSetID=tb_ErpSatisfactionRatingSet.ID
  240. left join View_Customer_PaymentOrdersTwo on Sfs_OrderNumber=Ord_Number
  241. GO